package cn.edu.scau.cmi.liangzijian.composite.consistent;

import java.util.List;

public class ConsistentPerson implements ConsistentOrganization {
	
	private String name;
	
	private ConsistentOrganization parent;
	
	public ConsistentPerson(String name) {
		this.name = name;
	}

	@Override
	public void say() {
		System.out.println("我的名字是："+name);
	}
	
	@Override
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public String getName() {
		return name;
	}

	@Override
	public boolean add(ConsistentOrganization p) {
		return false;
		//throw new UnsupportedOperationException("个人无法添加下属成员");
	}

	@Override
	public boolean remove(ConsistentOrganization p) {
		return false;
		//throw new UnsupportedOperationException("个人无下属成员");
	}

	@Override
	public List<ConsistentOrganization> getMemberList() {
		return null;
		//throw new UnsupportedOperationException("个人无下属成员");
	}

	@Override
	public void setParent(ConsistentOrganization parent) {
		this.parent = parent;
	}

	@Override
	public ConsistentOrganization getParent() {
		return parent;
	}

	@Override
	public boolean remove(String name) {
		return false;
	}

	@Override
	public ConsistentOrganization getOrganization(String name) {
		
		return null;
	}
}
